<template>
  <view>
    <my-message-top :text="'历史记录'" :pic="'../../static/more.png'"></my-message-top>
    <view class="my-history" >
      <view class="my-history-box" v-for="(item,i) in HistoryLsit" :key="i" @click="gotoHistoryDetail(item.id)">
        <image :src="item.img" mode=""></image>
      </view>
    </view>
  </view>
</template>

<script>
  import {getHistoryList} from '../../api/history.js'
  export default {
    data() {
      return {
        queryObj:{
          pageNum: 1,
          pageSize: 6,
        },
        total: 0,
        HistoryLsit:[]
      };
    },
    onLoad(){
      this.getHistoryList()
    },
    methods:{
      async getHistoryList(){
        const {data:data} = await getHistoryList(this.queryObj)
        console.log(data);
        this.HistoryLsit = data.data.imgs
        console.log(this.HistoryLsit);
      },
      gotoHistoryDetail(id){
        uni.navigateTo({
          url: '/subpkg/history-detail/history-detail?id=' + id
        })
      }
    }
  }
</script>

<style lang="scss">
.my-history{
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin: 25rpx 25rpx;
  .my-history-box{
    image{
      width: 337rpx;
      height: 236rpx;
    }
    margin-bottom: 20rpx;
  }
}
</style>
